jquery.equalizecols.js

This is the OLD version of the plugin. The latest version that is no longer dependent on the jquery dimensions plugin can be found here.

Tested in: IE7, FF1.5 (Windows XP), FF2 (OS X), Safari 2.0.4

Change Log

DateNotes
5/8/2007Initial release
5/9/2007Now compensating for top/bottom borders/padding when setting the element height. However, this requires that document is using the W3C box model and that the borders/padding are specified in px. The IE "quirks" box model and em or % units are not currently supported.
5/10/2007Renamed an internal function. Added notes regarding how to handle dynamic content in a column and browser text-resizing.

Examples

$("#col1, #col2, #col3").equalizeCols();
This is column 1
This is column 2
This is column 2
This is column 2
This is column 3
This is column 3
This is column 3
This is column 3
This is column 3
This is column 3
This is column 3

Notes

If any of the columns contain dynamically updated content, you'll want to call $(elems).equalizeCols() anytime that you show/hide/update content in one of the columns.

A slightly more difficult issue is how to handle text resizing in the browser. So far, the only way I've found to deal with that is to use the jQem plugin:

http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/

Then do something like this to resize the columns if the browser font size changes:

$(document).ready(function() {
    $.jqem.init();
    $.jqem.bind( function() {
        $(elems).equalizeCols();
    });

});
So far, this technique seems to work pretty well for me.

Download

» Download jquery.equalizecols.js